package Bubble;

import java.util.*;

import Part.Parts;
import PathPoint.Path;

import com.golden.gamedev.Game;

/**
 * A class holding bubbles to be shot
 * @author Yin
 *
 */
public class BubblePath extends Bubbles
{
	
	public BubblePath(Game game, Path path, Parts parts)
	{
		super(game, path, parts);
	}
	
	/**
	 * Set parameters
	 * @param p1
	 * @param p2
	 */
	public void setP(double p1, double p2)
	{
		for(Bubble bub: getList())
		{
			bub.setP(p1, p2);
		}
	}

	public void update(double elapsedTime)
	{
		super.update((long) elapsedTime*1000);
		removeInactiveSprites();
	}
	
	/**
	 * Add new bubble to the end of BubblePath since it is still in game
	 */
	public void addBubble(Bubble bubble)
	{
		add(getRandomBubble(false, getList()));
	}
}
